<div class="wrapper">
    <div>
        <div class="box box-top">
            <!-- /.box-header -->
            <!-- form start -->
            <form id="dataDicForm" role="form" action="${base}/admin/dataDic/save" method="post">
                <input type="hidden" name="id" value="${(dataDic.id)!}">
                <input type="hidden" name="dataDicTypeId" value="${(dataDic.dataDicTypeId)!}">
                <input type="hidden" name="departmentId" value="${(dataDic.departmentId)!}">
                <input type="hidden" name="catagory" value="${(dataDic.catagory)!}">
                <div class="box-body">
                    <div class="form-group">
                        <label for="name">区域</label>
                        ${(t.department.name)!}
                    </div>
                    <div class="form-group">
                        <label for="name">分类1</label>
                        ${(t.dataDicType.name)!}
                    </div>
                    <div class="form-group">
                        <label for="name">分类2</label>
                        ${nav.getDicCatagoryStr(t.catagory!"")}
                    </div>
                    <div class="form-group">
                        <label for="name">Name</label>
                        <input type="text" value="${(dataDic.name)!}" class="form-control" name="name" id="name">
                    </div>

                    <div class="form-group">
                        <label for="code">Code（备用字段）</label>
                        <input type="text" value="${(dataDic.code)!}" class="form-control" name="code" id="code">
                    </div>

                    <div class="form-group">
                        <label for="value">押金金额</label>
                        <input type="text" value="${(dataDic.value)!}" class="form-control" name="value" id="value">
                    </div>

                    <div class="form-group">
                        <label for="remark">Note</label>
                        <input type="text" value="${(dataDic.remark)!}" class="form-control" name="remark" id="remark">
                    </div>

                    <div class="form-group">
                        <label for="valid">Valid</label>
                        <select name="valid" id="valid" class="form-control">
                            <option value="true"<#if ((dataDic.valid)!true)==true> selected="selected" </#if>>----Valid----</option>
                            <option value="false"<#if ((dataDic.valid)!true)==false> selected="selected"</#if>>----Invalid----</option>
                    </select>
                </div>


                <div class="box-footer">
                    <button type="button" onclick="$('#dataDicForm').submit();" class="btn btn-primary">Save
                    </button>
                </div>
        </div>
        </form>
    </div>
</div>
</div>
<script type="text/javascript">
    $(function () {
        $("#dataDicForm").validate({
            submitHandler: function (form) {
                submitDataDic();
            }
        });
    });

    function submitDataDic() {
        HF.ajaxFormSubmit('dataDicForm', function (result) {
            alert("Save Success");
            document.location.reload();
        }, function (e) {
            alert("Save Failure");
        });
    }
</script>
